Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gallery example to show usage of dcw parameter in Figure.coast #2428

Merged
merged 28 commits into from
Aug 31, 2023

Conversation

michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Mar 15, 2023

Description of proposed changes

This PR adds a gallery example to show the basic usage of the dcw parameter.

Preview: https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Mar 15, 2023
@michaelgrund michaelgrund added this to the 0.9.0 milestone Mar 15, 2023
@michaelgrund michaelgrund marked this pull request as draft March 15, 2023 14:33
@michaelgrund
Copy link
Member Author

/format

Copy link
Contributor

@willschlitzer willschlitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not marked ready for review, but here are some changes I thought would be good.

examples/gallery/maps/country_polygons.py Outdated Show resolved Hide resolved
examples/gallery/maps/country_polygons.py Outdated Show resolved Hide resolved
examples/gallery/maps/country_polygons.py Outdated Show resolved Hide resolved
examples/gallery/maps/country_polygons.py Outdated Show resolved Hide resolved
@willschlitzer
Copy link
Contributor

@michaelgrund Is this ready for review, or are you still working on it?

@michaelgrund michaelgrund marked this pull request as ready for review May 5, 2023 06:48
@michaelgrund
Copy link
Member Author

@michaelgrund Is this ready for review, or are you still working on it?

Yes it is, thanks for your comments and improvements @willschlitzer.

@michaelgrund michaelgrund added the needs review This PR has higher priority and needs review. label May 5, 2023
@michaelgrund
Copy link
Member Author

/format

@seisman
Copy link
Member

seisman commented May 5, 2023

For unknown reasons, all the inline comments disappear in the built page (https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html).

Co-authored-by: Yvonne Fröhlich <[email protected]>
@michaelgrund
Copy link
Member Author

For unknown reasons, all the inline comments disappear in the built page (https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html).

Strange, also the title changes are not considered.

@yvonnefroehlich
Copy link
Member

For unknown reasons, all the inline comments disappear in the built page (https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html).

Strange, also the title changes are not considered.

Hm. Did someone change something to fix this? If not, that's really strange, because I face none of these issues. As title of this gallery example I see "Highlight country and continent polygons" (not "Highlight country polygons") and the inline examples are displayed in the API references.

@michaelgrund
Copy link
Member Author

michaelgrund commented May 5, 2023

For unknown reasons, all the inline comments disappear in the built page (https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html).

Strange, also the title changes are not considered.

Hm. Did someone change something to fix this? If not, that's really strange, because I face none of these issues. As title of this gallery example I see "Highlight country and continent polygons" (not "Highlight country polygons") and the inline examples are displayed in the API references.

In my case it depends on the device. On my smartphone everything looks fine, when using my laptop the title and comments are not included... after a click on refresh in my browser now it looks also fine on my laptop.

@seisman
Copy link
Member

seisman commented May 5, 2023

For unknown reasons, all the inline comments disappear in the built page (https://pygmt-dev--2428.org.readthedocs.build/en/2428/gallery/maps/country_polygons.html).

Strange, also the title changes are not considered.

Hm. Did someone change something to fix this? If not, that's really strange, because I face none of these issues. As title of this gallery example I see "Highlight country and continent polygons" (not "Highlight country polygons") and the inline examples are displayed in the API references.

In my case it depends on the device. On my smartphone everything looks fine, when using my laptop the title and comments are not included... after a click on refresh in my browser now it looks also fine on my laptop.

Yes, now it looks good.

@michaelgrund
Copy link
Member Author

Maybe we can add another section for showing how to highlight states/territories of a country (if available), something like:

import pygmt

fig = pygmt.Figure()
fig.coast(
    region=[-130, -70, 24, 52],
    projection="L-100/35/33/45/12c",
    land="gray",
    shorelines="1/0.5p",
    borders=["1/0.8p,black", "2/0.2p,black"],
    frame=True,
    dcw=[
        # Texas with orange fill
        "US.TX+gorange",
        # Kentucky with blue outline
        "US.KY+p1p,blue",
    ],
)

fig.show()

polygons_stats

Added this use-case.

@michaelgrund
Copy link
Member Author

/format

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion on the projection for Europe, otherwise ready for final review!

examples/gallery/maps/country_polygons.py Outdated Show resolved Hide resolved
@weiji14 weiji14 added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Aug 29, 2023
Added also "state" to the title since now we're showing 3 different use-cases.
@weiji14 weiji14 merged commit 3874b26 into main Aug 31, 2023
@weiji14 weiji14 deleted the gallery-dcw branch August 31, 2023 09:35
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants